

namespace NodeBasedSkillEditor.Model.Node.RT
{
    public class Node_DivideByScalar_RT : RT_Node
    {
        public RT_SingleValuePort Base_RT;

        public RT_SingleValuePort Divisor_RT;

        public RT_SingleValuePort Result_RT;

        public Node_DivideByScalar_RT(Node_DivideByScalar sourceData, RT_DAG parentDag) : base(sourceData, parentDag)
        {
            Base_RT = new RT_SingleValuePort(EPortIOType.Input, sourceData.Base, this);

            Divisor_RT = new RT_SingleValuePort(EPortIOType.Input, sourceData.Divisor, this);

            Result_RT = new RT_SingleValuePort(EPortIOType.Output, sourceData.Result, this);
            Result_RT.OnGetValue = GetResult;
        }

        public AValue GetResult(DAG_Executor executor)
        {
            Result_RT.SourceValue.Assign(Base_RT.GetValue(executor));
            Result_RT.SourceValue.DivideBy(Divisor_RT.GetValue(executor));
            return Result_RT.SourceValue;
        }
    }
}